<?php
class AccessModel extends Model{
    protected $fields=array(
        'role','nodeId','level','parentNodeId','status',
        '_autoInc'=>false
    );
    
    /**
     * 批量插入数据
     */
    public function addAll($datas){
        $this->startTrans();
        foreach($datas as $row){
            if(false === $this->add($row)){
                $this->rollback();
                return false;
            }
        }
        $this->commit();
        return true;
    }
    
}
